# Maintainer: Brandon Boese <brandonboese@protonmail.com>
pkgname=lomiri-calculator-app
pkgver=4.0.2
pkgrel=0
pkgdesc="A powerful and easy to use calculator"
url="https://gitlab.com/ubports/development/apps/lomiri-calculator-app"
arch="all !armhf" # blocked by lomiri-ui-toolkit
license="GPL-3.0-only"
source="https://gitlab.com/ubports/development/apps/lomiri-calculator-app/-/archive/v$pkgver/lomiri-calculator-app-v$pkgver.tar.gz
	0001-point-qmlscene-to-qmlscene-qt5.patch
	"
depends="
	lomiri-ui-extras
	lomiri-ui-toolkit
	qqc2-suru-style
	"
makedepends="
	click-dev
	cmake
	cmake-extras
	lomiri-trust-store-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	samurai
	"
checkdepends="
	py3-dbusmock
	py3-xdg
	xvfb-run
	"
subpackages="$pkgname-lang"
builddir="$srcdir/$pkgname-v$pkgver"
options="!check" # requires autopilot

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		-DCLICK_MODE=OFF \
		-DINSTALL_TESTS=OFF
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
7642f8e62ce7a2e11474155790283f21c9ab1b16462f16541f5937bfbda1c2eed400fd553a451bb9acacfe8d12348696524d43198ae2745e78bd501f04baa8e7  lomiri-calculator-app-v4.0.2.tar.gz
86d64f4be2f8277ee044a3b6b7041e4ff6694606f4a506ad1f9f970382ca10ae0ccc3d1b242589ca5e17f26b6258b688587770128c8449c61bce1bb8206fc4f1  0001-point-qmlscene-to-qmlscene-qt5.patch
"
